
package com.uuah.server.api.transport;

import java.io.Serializable;
import java.util.Map;
import java.util.Set;

import com.uuah.server.api.IExceptionPayload;
import com.uuah.server.transport.PropertyScope;

/**
 * <code>MessageAdapter</code> provides a common abstraction of different
 * message implementations provided by different underlying technologies.
 *
 * <p>update record:updator，update time，update content and version</p>
 * @author <a href="jonny_quan@hotmail.com">jonny</a>
 * @date 2009 2009-3-27 上午12:11:25
 * @version 1.0.0
 */
public interface IMessageAdapter extends Serializable {


	void addProperties(Map properties);

	void addProperties(Map properties, PropertyScope scope);

	void clearProperties();

	Object getProperty(String key);

	void setProperty(String key, Object value);

	void setProperty(String key, Object value, PropertyScope scope);

	Object removeProperty(String key);

	Set getPropertyNames();

	Object getPayload();

	void setPayload(Object payload);

	String getUniqueId();

	Object getProperty(String name, Object defaultValue);

	int getIntProperty(String name, int defaultValue);

	long getLongProperty(String name, long defaultValue);

	double getDoubleProperty(String name, double defaultValue);

	boolean getBooleanProperty(String name, boolean defaultValue);

	void setBooleanProperty(String name, boolean value);

	void setIntProperty(String name, int value);

	void setLongProperty(String name, long value);

	void setDoubleProperty(String name, double value);

	String getStringProperty(String name, String defaultValue);

	void setStringProperty(String name, String value);

	IExceptionPayload getExceptionPayload();

	void setExceptionPayload(IExceptionPayload payload);

	String getEncoding();

	void setEncoding(String encoding);

	void release();

	Map getScopeProperties(PropertyScope scope);
}
